-
Notifications
You must be signed in to change notification settings - Fork 405
Explicitly reject routes that double-back #2741
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking a stab at this!
- If a path within a route passes through the same channelID twice, that shows the path is looped and will be rejected by nodes. - Add a check to explicitly reject such payment before trying to send them.
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #2741 +/- ##
==========================================
- Coverage 88.55% 88.52% -0.04%
==========================================
Files 113 113
Lines 89330 89351 +21
Branches 89330 89351 +21
==========================================
- Hits 79110 79097 -13
- Misses 7849 7877 +28
- Partials 2371 2377 +6 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty much looks good to me. Could we add some test coverage for it though?
You could add a tiny test case checking that we receive the correct APIError
if we try to use a looping route. The setup should be similar to, e.g., fn test_update_add_htlc_bolt2_sender_cltv_expiry_too_high()
in functional_tests.rs
.
- Also modify the unwrap_send_err!() macro to handle the PathParameterError
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Resolves #2215